<template>
{{#if page.psSysPFPlugin}}
    {{> @macro/plugins/view/view-use.hbs appPlugin=page.psSysPFPlugin}}
{{else}}
    {{#if page.psViewLayoutPanel.useDefaultLayout}}
    <AppViewLayout :class="classNames">
        <template v-if="!noViewCaption && model.showCaption" #viewHeaderCenter>
            <div class="view-header__center__caption">
                {{> @macro/view/view-caption.hbs}}
            </div>
        </template>
        {{> @macro/view/view-toolbar.hbs page=page}}
        <template #default>
        {{#each page.ctrls as | ctrl |}}
        {{#eq ctrl.controlType 'DRTAB'}}
            {{> @macro/widgets/drtab-detail/drtab.hbs ctrl=ctrl}}
        {{/eq}}
        {{#eq ctrl.controlType 'FORM'}}
            {{> @macro/widgets/form-detail/form.hbs ctrl=ctrl props="v-show='!store.selection.appViewName'"}}
            <component
                :is="store.selection.appViewName"
                class="view-container2"
                openType="EMBED"
                :name="store.selection.appViewName"
                :context="store.selection.context || store.context"
                :viewParams="store.selection.viewParams || store.viewParams"
            />
        {{/eq}}
        {{/each}}
        </template>
        {{> @macro/view/view-msg.hbs}}
    </AppViewLayout>
    {{else}}
    <div :class="classNames">
        {{#if page.psViewLayoutPanel.rootPSPanelItems}}
        {{#each page.psViewLayoutPanel.rootPSPanelItems as | panelItem |}}
        {{> @macro/widgets/panel-detail/include-panel.hbs type=panelItem.itemType item=panelItem isMultiData=false panel=page.psViewLayoutPanel page=page}}
        {{/each}}
        {{/if}}
    </div>
    {{/if}}
{{/if}}
</template>

// 基于template/src/views/\{{appModules}}/\{{pages@DEMOBEDITVIEW3}}/\{{spinalCase page.codeName}}.vue.hbs生成
<script lang="ts" setup>
{{#if page.psViewLayoutPanel.useDefaultLayout}}
import { AppViewLayout } from "@components/layout/view-layout";
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
{{else}}
import { AppCtrlPos, AppScrollContainer, AppSimpleFlexContainer, AppStandardContainer, AppTabPanel, AppTabPage } from '@components/layout-element/structure';
{{#if page.psViewLayoutPanel.viewProxyMode}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.psViewLayoutPanel.psControls}}
{{else}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
{{/if}}
{{/if}}
import { model } from "./{{spinalCase page.codeName}}-model";
import { 
    useNavParamsBind, 
    useEventBind,
    handleToolbarItemClick,
    handleCtrlAction, 
    handleCtrlInit, 
    handleCtrlDestroy, 
    getViewBackVisible,
    getViewClassNames,
} from "@/hooks/use-view";
import { EditView3ActionType, IParam, IEditView3Ability, IEditView3ControllerParams, IEditView3Store, EditView3Controller,ILoadingHelper, IContext, IEditView3Controller } from '@/core';

{{> @macro/view/view-props.hbs}}

{{> @macro/common/emit.hbs name="view" actionType="EditView3ActionType" ability="IEditView3Ability"}}

{{> @macro/view/view-common.hbs}}

const params: IEditView3ControllerParams<EditView3ActionType, IEditView3Ability> = { 
    name: props.name,
    model, 
    evt,
    isLoadDefault: props.isLoadDefault,
    openType:props.openType, 
    pLoadingHelper:props.pLoadingHelper, 
    handler: (data: IEditView3Store) => { return reactive(data); } 
};

{{> @macro/common/controller.hbs name="view" IController="IEditView3Controller" store="IEditView3Store" ability="IEditView3Ability" controller="EditView3Controller"}}
</script>
